package com.mifengkong.cygshare.model;

import com.mifengkong.cygshare.bean.CreateOrderBean;
import com.mifengkong.cygshare.constant.ServletAddressConstant;
import com.mifengkong.frtools.http.request.HttpFunction;

import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 2018/1/16
 */

public class CreateOrderModel extends BaseModel {

    public static CreateOrderModel getInstance() {
        return getPresent(CreateOrderModel.class);
    }

    public void execute(String orderId, Observer<CreateOrderBean> observer) {
        addParamStrings("vip_id", orderId);
        addParamStrings("pay_way", "1");
        Observable<CreateOrderBean> observable = mServletApi.setOrderMessage(mParams).map(new HttpFunction<CreateOrderBean>());
        toSubscribe(observable, observer);
    }

    @Override
    protected String getDoMainType() {
        return ServletAddressConstant.KA_MAO;
    }
}
